#ifndef __COMMON_H
#define __COMMON_H

/* app include */
#include "usart_analyse.h"
//#include "test.h"
//#include "pid.h"
#include "key_action.h"
#include "can_analyse.h"
#include "runtime.h"
#include "includes.h"
#include "tcp_server.h"

#define TX_SFID 0x12
#define SLAVE_CAN_BASE_ID 0x30
#define MAX_MCUID_NUM 7
#define START_MCUID 1

/* function */
#define UPLOAD_COMMUICIATION_BOARD_TEMP 0  

/* usart command */
#define UART_REC_CONFIG_CODE 0x01
#define UART_UPLOAD_COMMUICIATION_BOARD_TEMP 0x02
#define UART_UPLOAD_CAN_BASIC_STATUS 0x03
#define UART_UPLOAD_SYS_RUNTIME 0x04
#define UART_UPLOAD_START_SIGNAL 0x05
#define UART_UPLOAD_BASIC_STATUS 0x06
#define UART_REC_CTRL_CODE 0x07
#define UART_UPLOAD_CHART_POINT 0x08

/* master can command */
#define CAN_DONWLOAD_CONFIG_CODE 0x21
#define CAN_DONWLOAD_CTRL_CODE 0x22

/* slave can command */
#define CAN_UPLOAD_BASIC_STATUS 0x51
#define CAN_RETURN_ACK 0x52
#define CAN_UPLOAD_IO_STATUS_GROUP_HIGH_4BYTE 0x53
#define CAN_UPLOAD_IO_STATUS_GROUP_LOW_4BYTE 0x54

ReceiveMemberDataPackage_T* getMcuIDxData();
void app_init(void);
void send_config_code_to_can(uint8_t *Buff);
void main_show_can_receive_msg();
void main_upload_package();

extern QueueHandle_t* getQueue1Handle();
extern QueueHandle_t* getQueue2Handle();
extern SemaphoreHandle_t* getxSemaphoreHandle();

void Delay_Ms(uint32_t n);
void Delay_Us(uint32_t n);

void  App_Printf(char *format, ...);
#endif

